package Homework4;

import org.openqa.selenium.By;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import static org.testng.Assert.assertEquals;

/**
 * Created by Виталий on 25.03.14.
 */
public class RegistrarionRozetka extends BaseClass {

    @DataProvider(name = "test1")
    public Object[][] createData1() {
        return new Object[][] {
                { "Vitazzliiaas1234891", "vitaliiasxsdaszd112a91@gmail.com", "12345adsa" },
               // { "Vitazzliiaas1234", "vitaliiasxsdaszd112@gmail.com", "12345adsa" },
        };
    }
    @Test(dataProvider = "test1")
    public void test(String Name, String Email, String Password) throws Exception {

         System.out.println("Begin Test - Registration");
         driver.get(baseUrl);
         System.out.println("HomePage");

         driver.manage().window().maximize();

         driver.findElement(By.xpath("//*[@id='user_menu']/div/a")).click();

         driver.findElement(By.xpath("/html/body/header/div/div/div/div[3]/div[3]/div/div/div/form/div[5]/a")).click();

         driver.findElement(By.name("title")).sendKeys(Name);

         driver.findElement(By.name("email")).sendKeys(Email);

         driver.findElement(By.name("password")).sendKeys(Password);

         driver.findElement(By.className("button-css-green")).click();

         assertEquals(driver.findElement(By.className("field")).getText(), Name, "Error:Successful Registration");
}
}
